<template>
  <table>
    <thead>
      <tr>
        <th>ID</th><th>学号</th><th>姓名</th><th>专业</th><th>班级</th>
        <th>年级</th><th>院系</th><th>导师</th><th>入学时间</th><th>状态</th><th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="stu in students" :key="stu.id">
        <td>{{stu.id}}</td>
        <td>{{stu.studentNumber}}</td>
        <td>{{stu.name}}</td>
        <td>{{stu.major}}</td>
        <td>{{stu.className}}</td>
        <td>{{stu.grade}}</td>
        <td>{{stu.department}}</td>
        <td>{{stu.supervisor}}</td>
        <td>{{stu.enrollmentDate}}</td>
        <td>
          <span v-if="stu.status==1">在读</span>
          <span v-else-if="stu.status==2">毕业</span>
          <span v-else>休学</span>
        </td>
        <td>
          <button @click="$emit('edit', stu)">编辑</button>
          <button @click="$emit('delete', stu.id)">删除</button>
        </td>
      </tr>
    </tbody>
  </table>
</template>
<script setup>
defineProps(['students']);
</script> 